import React from 'react'
import { Button, ButtonProps, Tooltip, TooltipProps } from 'antd'

interface Props {
  btnText?: string
  tooltipProps?: Partial<TooltipProps>
  buttonProps?: Partial<ButtonProps>
  children?: React.ReactNode
}

export default function TooltipButton({ btnText, children, tooltipProps, buttonProps }: Props) {
  return (
    <Tooltip {...tooltipProps}>{children || <Button {...buttonProps}>{btnText}</Button>}</Tooltip>
  )
}
